
import java.util.Random;
import java.util.Scanner;

public class UpsetString {
    //键盘录入字符串，打乱里面的内容
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        System.out.println("请输入任意字符串：");
        String str = sc.next();
        Random ran = new Random();
        char[] ch = str.toCharArray();
        //遍历字符数组，打乱里面的内容
        for (int i = 0; i < ch.length; i++) {
            int j = ran.nextInt(ch.length);
            char temp = ch[i];
            ch[i] = ch[j];
            ch[j] = temp;
        }
        //用StringBuilder拼接字符数组，并输出
        StringBuilder sb = new StringBuilder();
        for (char c : ch) {
            sb.append(c);
        }
        System.out.println(sb);


    }
}
